enqueueScripts([function(){ (window.webpackJsonpvtex_menu_2_35_3=window.webpackJsonpvtex_menu_2_35_3||[]).push([[0],{11:function(e,t,n){"use strict";var i=n(0),a=Object(i.createContext)(0);t.a=a},13:function(e,t,n){"use strict";var i=n(4),a=n(0),r=n.n(a),o=n(19),l=n(20),c=n(25),u=n(24),s=n(18),d=n(10),m=n(21),f=n.n(m),p=n(8);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return Object(u.a)(this,n)}}var y=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a-1?"submenu.accordion":"submenu"},b=n(9),h={x:null,y:null},O={x:null,y:null},g=0,k=0,j=0,E=function(e){if(O.x=e.pageX,O.y=e.pageY,null!=h.x&&null!=h.y){var t=e.timeStamp,n=Math.sqrt(Math.pow(O.x-h.x,2)+Math.pow(O.y-h.y,2)),i=t-k;j=Math.round(n/i*1e3),k=t}h.x=O.x,h.y=O.y},x=function(e,t){var n=t.delay,i=void 0===n?200:n,a=t.maxSpeed,o=void 0===a?450:a,l=Object(r.useRef)(null),c=(Object(r.useEffect)((function(){return 0===g&&window.addEventListener("mousemove",E),g+=1,function(){(g-=1)>0||(h.x=null,h.y=null,O.x=null,O.y=null,window.removeEventListener("mousemove",E))}}),[]),{getMouseSpeed:function(){return j||0}}).getMouseSpeed;return function(){for(var t=arguments.length,n=new Array(t),a=0;ao?e.apply(void 0,n):null!=r&&r===a||(l.current=window.setTimeout(t,i)),r=a}),i)}},w=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a0;){var c=l;l=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(t){var i=a(e,t);i&&n.definitions.push(i)})),n}(n,"category")},8:function(e,t,n){"use strict";var i=n(4),a=n(6),r=n.n(a),o=n(0),l=n.n(o),c=n(1),u=n.n(c),s=n(2),d=n(16),m=n.n(d),f=n(11),p=n(9),v=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a0;){var l=o;o=new Set,l.forEach((function(e){d.has(e)||(d.add(e),(t[e]||new Set).forEach((function(e){o.add(e)})))}))}return d.forEach((function(n){var t=a(e,n);t&&i.definitions.push(t)})),i}(i,"categoryWithChildren")},,,,,,,,,,function(e,n,i){"use strict";i.r(n),function(e){var n=i(3);i.p=Object(n.getPublicPath)("vtex.menu@2.35.3");var t=Object(n.register)((function(){return i(35)}),e,"vtex.menu@2.35.3","vtex.menu@2.x","Menu");t.renderHotReload,t.setupHMR}.call(this,i(7)(e))},,,function(e,n,i){"use strict";i.r(n);var t,a=i(4),r=i(0),d=i.n(r),o=i(6),l=i.n(o),c=i(5),m=i(1),u=i.n(m),s=i(2),v=i(10),f=i(22),g=i.n(f),h=i(8),p=function(e){var n=e.href,i=e.titleTag,t=e.isTitle,a=e.name;return d.a.createElement(h.a,{title:i,to:n,isTitle:t},a)},k=function(e){var n=e.categoryId;return null==n?null:d.a.createElement(v.Query,{query:g.a,variables:{id:n}},(function(e){var n=e.data,i=e.loading;if(e.error||i)return null;var t=n.category,r=n.category.children;return d.a.createElement(d.a.Fragment,null,d.a.createElement(p,Object(a.a)({},t,{isTitle:!0})),null==r?void 0:r.map((function(e){return d.a.createElement("li",{key:e.id},d.a.createElement(p,e))})))}))},y=i(13),b=i(11),_=i(9),N=i(17),x=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},t=e.bailOut,n=void 0!==t&&t,l=Object(a.useState)(!1),r=Object(o.a)(l,2),d=r[0],m=r[1];return Object(a.useEffect)((function(){if(!n){var e=i.current;if(e){if(!e.complete){var t=function(){m(!0)};return e.addEventListener("load",t),function(){e.removeEventListener("load",t)}}m(!0)}}}),[i,n]),d}(X,{bailOut:!F}),Z=Object(c.useIntl)(),ii=s()(f,{migrationFrom:"vtex.store-components@3.x",classes:U}).handles,ei={minWidth:I,minHeight:k,maxWidth:O,maxHeight:P},ti=Object.assign(Object.assign({},ei),{height:j,width:E}),ni=null!==(r=null!==(t=null!==(e=null!=N?N:j)&&void 0!==e?e:P)&&void 0!==t?t:k)&&void 0!==r?r:"auto",oi=/(auto|inherit|initial|unset)|[^\d]/g,ai=function(i){return""!==i&&i?i.toString().replace(oi,"$1"):null},li=ai(E),ri=null!==(g=null!==(m=ai(N))&&void 0!==m?m:ai(j))&&void 0!==g?g:ai(P),di=function(i){return null==i?void 0:i.toString().includes("%")},mi=!(!E||!N&&!P&&!j||di(E)||di(N)&&di(P)&&di(j)),si=u()({id:b,intl:Z}),ci=u()({id:x,intl:Z}),gi=l.a.createElement("img",Object(n.a)({title:D,sizes:_,srcSet:L,src:"string"==typeof si?si:"",alt:"string"==typeof ci?ci:"",ref:X,className:ii.imageElement,loading:B,fetchpriority:K},W&&mi?{width:null!==(h=null!=li?li:E)&&void 0!==h?h:"auto",height:null!=ri?ri:"auto",style:ei}:{style:ti},$?{"data-vtex-preload":"true"}:{})),ui=null!==(y=null==H?void 0:H.newTab)&&void 0!==y?y:null==H?void 0:H.openNewTab,pi=v()().push,hi="provide"===z?{id:C,name:J,creative:si,position:V,products:[{productId:A,productName:R}]}:void 0,vi=u()({id:null==H?void 0:H.url,intl:Z}),fi=u()({id:null==H?void 0:H.attributeTitle,intl:Z}),yi=(null==H?void 0:H.url)?l.a.createElement(p.Link,{to:"string"==typeof vi?vi:"",title:"string"==typeof fi?fi:"",rel:H.attributeNofollow?"nofollow":"",target:ui?"_blank":void 0,className:ii.imageElementLink,onClick:function(){"none"!==z&&pi({event:"promotionClick",promotions:[hi]})}},gi):l.a.createElement(a.Fragment,null,gi);return d()({ref:X,onView:function(){"none"===z||Q||pi({event:"promoView",promotions:[hi]})},once:!0}),F?l.a.createElement("span",{className:"dib",style:{height:Y?"auto":ni}},yi):yi}var b=Object(c.defineMessages)({title:{id:"admin/editor.store-image.title"}});y.schema={title:b.title.id},y.cssHandles=f,e.default=y},13:function(i,e,t){"use strict";t.d(e,"a",(function(){return a}));var n=t(2),o=Object(n.defineMessages)({title:{id:"admin/editor.image-list.title"},description:{id:"admin/editor.image-list.description"},imagesImageTitle:{id:"admin/editor.image-list.images.image.title"},imagesMobileImageTitle:{id:"admin/editor.image-list.images.mobileImage.title"},imagesImageDescription:{id:"admin/editor.image-list.images.description.title"},imagesImageAttributeTitle:{id:"admin/editor.image-list.images.title.title"},imagesImageLinkUrl:{id:"admin/editor.image-list.images.link.url.title"},imagesImageLinkOpenNewTab:{id:"admin/editor.image-list.images.link.openNewTab.title"},imagesImageLinkNoFollow:{id:"admin/editor.image-list.images.link.noFollow.title"},imagesImageLinkTitle:{id:"admin/editor.image-list.images.link.title.title"},imagesTitle:{id:"admin/editor.image-list.images.title"},heightTitle:{id:"admin/editor.image-list.height.title"},widthTitle:{id:"admin/editor.image-list.images.width.title"},widthDescription:{id:"admin/editor.image-list.images.width.description"},analyticsTitle:{id:"admin/editor.image.analytics.title"},analyticsNone:{id:"admin/editor.image.analytics.none"},analyticsProvide:{id:"admin/editor.image.analytics.provide"},analyticsPromotionId:{id:"admin/editor.image.analytics.promotionId"},analyticsPromotionName:{id:"admin/editor.image.analytics.promotionName"},analyticsPromotionPosition:{id:"admin/editor.image.analytics.promotionPosition"},analyticspromotionProductId:{id:"admin/editor.image.analytics.promotionProductId"},analyticspromotionProductName:{id:"admin/editor.image.analytics.promotionProductName"}}),a={title:o.title.id,description:o.description.id,type:"object",properties:{height:{default:"420",isLayout:!1,title:o.heightTitle.id,type:"string"}}}},14:function(i,e,t){"use strict";t.d(e,"a",(function(){return d}));var n=t(4),o=t(0),a=t.n(o),l=t(10),r=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(null!=i&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(i);o1&&void 0!==arguments[1]?arguments[1]:{},i=t.bailOut,n=void 0!==i&&i,a=Object(l.useState)(!1),r=Object(o.a)(a,2),s=r[0],u=r[1];return Object(l.useEffect)((function(){if(!n){var t=e.current;if(t){if(!t.complete){var i=function(){u(!0)};return t.addEventListener("load",i),function(){t.removeEventListener("load",i)}}u(!0)}}}),[e,n]),s}(X,{bailOut:!C}),Z=Object(d.useIntl)(),ee=c()(f,{migrationFrom:"vtex.store-components@3.x",classes:$}).handles,te={minWidth:w,minHeight:R,maxWidth:b,maxHeight:N},ie=Object.assign(Object.assign({},te),{height:P,width:y}),ne=null!==(r=null!==(i=null!==(t=null!=j?j:P)&&void 0!==t?t:N)&&void 0!==i?i:R)&&void 0!==r?r:"auto",oe=/(auto|inherit|initial|unset)|[^\d]/g,le=function(e){return""!==e&&e?e.toString().replace(oe,"$1"):null},ae=le(y),re=null!==(m=null!==(u=le(j))&&void 0!==u?u:le(P))&&void 0!==m?m:le(N),se=function(e){return null==e?void 0:e.toString().includes("%")},ue=!(!y||!j&&!N&&!P||se(y)||se(j)&&se(N)&&se(P)),ce=v()({id:h,intl:Z}),de=v()({id:O,intl:Z}),me=a.a.createElement("img",Object(n.a)({title:T,sizes:I,srcSet:k,src:"string"==typeof ce?ce:"",alt:"string"==typeof de?de:"",ref:X,className:ee.imageElement,loading:B,fetchpriority:K},D&&ue?{width:null!==(g=null!=ae?ae:y)&&void 0!==g?g:"auto",height:null!=re?re:"auto",style:te}:{style:ie},q?{"data-vtex-preload":"true"}:{})),ve=null!==(x=null==M?void 0:M.newTab)&&void 0!==x?x:null==M?void 0:M.openNewTab,pe=_()().push,ge="provide"===W?{id:V,name:z,creative:ce,position:F,products:[{productId:J,productName:U}]}:void 0,_e=v()({id:null==M?void 0:M.url,intl:Z}),fe=v()({id:null==M?void 0:M.attributeTitle,intl:Z}),xe=(null==M?void 0:M.url)?a.a.createElement(p.Link,{to:"string"==typeof _e?_e:"",title:"string"==typeof fe?fe:"",rel:M.attributeNofollow?"nofollow":"",target:ve?"_blank":void 0,className:ee.imageElementLink,onClick:function(){"none"!==W&&pe({event:"promotionClick",promotions:[ge]})}},me):a.a.createElement(l.Fragment,null,me);return s()({ref:X,onView:function(){"none"===W||Q||pe({event:"promoView",promotions:[ge]})},once:!0}),C?a.a.createElement("span",{className:"dib",style:{height:Y?"auto":ne}},xe):xe}var h=Object(d.defineMessages)({title:{id:"admin/editor.store-image.title"}});x.schema={title:h.title.id},x.cssHandles=f,t.default=x},,,,,,,,function(e,t,i){"use strict";i.r(t),function(e){var t=i(3);i.p=Object(t.getPublicPath)("vtex.store-image@0.23.1");var n=Object(t.register)((function(){return i(10)}),e,"vtex.store-image@0.23.1","vtex.store-image@0.x","Image");n.renderHotReload,n.setupHMR}.call(this,i(12)(e))}],[[18,"common"]]]); },function(){ !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],d=0,s=[];de.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var f=function(e,t,n){var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return m(i)},v=n(12);const h=async()=>{},p=Object(r.createContext)({addItem:h,addItems:h,updateQuantity:h,removeItem:h,setManualPrice:h}),I=()=>Object(r.useContext)(p),g={queue:[]},y=e=>{var t;let n=null;try{n=JSON.parse(null!==(t=localStorage.getItem("orderQueue"))&&void 0!==t?t:"null")}catch{}if(!n)try{localStorage.setItem("orderQueue",JSON.stringify(g))}catch(t){null==e||e({type:"Error",level:"Critical",event:t,workflowType:"OrderItems",workflowInstance:"get-local-order-queue"})}return null!=n?n:g},w=(e,t)=>{try{localStorage.setItem("orderQueue",JSON.stringify(e))}catch(e){null==t||t({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"save-local-order-queue"})}},b=(e,t)=>{const n=y(),i=n.queue.push(e);return w(n,t),i},k=(e=0,t)=>{const n=y(t),i=n.queue[e];if(i)return n.queue.splice(e,1),w(n,t),i},T="available",q=(e,t,n)=>{var i,r,a;const u=(null===(i=e.id)||void 0===i?void 0:i.toString())===t.id,s=e.seller===t.seller;if(t.isGift)return!1;if(null==e.options||!(null===(r=e.options)||void 0===r?void 0:r.length))return!(null===(a=t.attachments)||void 0===a?void 0:a.length)&&(u&&s);const o=e.options.every(e=>n.find(t=>t.id===e.id));return u&&s&&o},O=e=>{var t;return{id:+(null!==(t=e.id)&&void 0!==t?t:0),index:e.index,quantity:e.quantity,seller:e.seller,options:e.options}},M=(e,t)=>{var n,i,r,a;return{id:t.id,productId:t.productId,name:t.name,skuName:t.skuName,skuSpecifications:t.skuSpecifications,imageUrls:{at1x:t.imageUrl,at2x:t.imageUrl,at3x:t.imageUrl},price:t.price,listPrice:t.listPrice,sellingPrice:t.sellingPrice,measurementUnit:t.measurementUnit,quantity:null!==(n=t.quantity)&&void 0!==n?n:1,unitMultiplier:null!==(i=t.unitMultiplier)&&void 0!==i?i:1,uniqueId:null!==(r=e.uniqueId)&&void 0!==r?r:f(),detailUrl:t.detailUrl,availability:null!==(a=t.availability)&&void 0!==a?a:T,additionalInfo:t.additionalInfo,options:t.options,seller:t.seller,attachmentOfferings:[],attachments:[],bundleItems:[],offerings:[],priceTags:[],isGift:!1}},x=e=>void 0!==e;function C({useMutateAddItems:e,useOrderForm:t,useLogger:n}){return i=>{var a;const{setOrderForm:u}=t(),s=e(),{log:o}=null!==(a=null==n?void 0:n())&&void 0!==a?a:{};return Object(r.useCallback)(({mutationInputItems:e,mutationInputMarketingData:t,orderFormItems:n,salesChannel:r,allowedOutdatedData:a})=>({execute:async()=>{var l;const{data:d,errors:c}=await s({items:e,marketingData:t,salesChannel:r,allowedOutdatedData:a});if(!d||(null!==(l=null==c?void 0:c.length)&&void 0!==l?l:0)>0)throw null==c?void 0:c[0];return n.forEach(e=>{const t=null==d?void 0:d.items.find(t=>t.id===e.id);if(!t)return;const n=e.uniqueId;(({fakeUniqueId:e,uniqueId:t},n)=>{const i=y(n);i.queue=i.queue.map(n=>{if("update_mutation"!==n.type)return n;const i=n.variables.orderItems.findIndex(t=>"uniqueId"in t&&t.uniqueId===e);return i>-1&&(n.variables.orderItems[i]={...n.variables.orderItems[i],uniqueId:t}),n}),w(i,n)})({fakeUniqueId:n,uniqueId:t.uniqueId},o),i.current[n]=t.uniqueId}),u(n=>({...n,items:n.items.map(t=>{if(-1===e.findIndex(e=>q(e,t,n.items)))return t;const i=d.items.find(e=>e.id===t.id);return i?{...t,uniqueId:i.uniqueId}:null}).filter(e=>null!=e),marketingData:null!=t?t:n.marketingData})),d},rollback:()=>{u(t=>{const n=e.map(({id:e})=>e.toString());return{...t,items:t.items.filter(e=>!n.includes(e.id))}})}}),[i,o,s,u])}}const _=({totalizers:e,currentValue:t=0,newItem:n,oldItem:i})=>{var r,a,u,s,o;if((null==i?void 0:i.availability)!==T)return{totalizers:e,value:t};const l=(null!==(r=i.price)&&void 0!==r?r:0)*(null!==(a=i.unitMultiplier)&&void 0!==a?a:1),d=null!==(u=i.quantity)&&void 0!==u?u:0,c=null!==(s=i.sellingPrice)&&void 0!==s?s:0,m=l*d,f=n.price*(null!==(o=n.unitMultiplier)&&void 0!==o?o:1),v=f*n.quantity-m,h=(c-l)*d,p=(n.sellingPrice-f)*n.quantity-h,I=t+v+p;if(!e.length)return{totalizers:[{id:"Items",name:"Items Total",value:v},{id:"Discounts",name:"Discounts Total",value:p}],value:I};return{totalizers:e.map(e=>{switch(e.id){case"Items":return{...e,value:e.value+v};case"Discounts":return{...e,value:e.value+p};default:return e}}),value:I}},D=async()=>{};function E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}){const l=C({useMutateAddItems:e,useOrderForm:i}),d=function({useMutateSetManualPrice:e}){return()=>{const t=e();return Object(r.useCallback)((e,n)=>{if(t)return{execute:async()=>{var i;const{data:r,errors:a}=await t({itemIndex:n,price:e});if(!r||(null!==(i=null==a?void 0:a.length)&&void 0!==i?i:0)>0)throw null==a?void 0:a[0];return r}}},[t])}}({useMutateSetManualPrice:n}),c=function({useMutateUpdateQuantity:e,useOrderForm:t}){return n=>{const{setOrderForm:i}=t(),a=e();return Object(r.useCallback)(({items:e,orderFormItems:t,id:r,allowedOutdatedData:u,splitItem:s})=>({id:r,execute:async()=>{var t;const i={orderItems:e.map(e=>{if("uniqueId"in e){return{uniqueId:n.current[e.uniqueId]||e.uniqueId,quantity:e.quantity}}return e}),allowedOutdatedData:u,splitItem:s},{data:r,errors:o}=await a(i);if(!r||(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0)throw null==o?void 0:o[0];return r},rollback:()=>{const n=e.filter(({quantity:e})=>0===e),r=e.filter(({quantity:e})=>0!==e),a=n.map(e=>t.find((t,n)=>"uniqueId"in e?t.uniqueId===e.uniqueId:e.index===n)).filter(x);i(e=>({...e,items:e.items.map(e=>{const n=r.findIndex((t,n)=>"uniqueId"in t?e.uniqueId===t.uniqueId:n===t.index);if(-1!==n){const i=r[n],a=t.find((e,t)=>"uniqueId"in i?e.uniqueId===i.uniqueId:t===i.index);return{...e,quantity:a.quantity}}return e}).concat(a)}))}}),[n,a,i])}}({useMutateUpdateQuantity:t,useOrderForm:i});return{OrderItemsProvider:({children:e})=>{const{orderForm:t,setOrderForm:n}=i(),{log:m}=u(),h=function({useOrderQueue:e}){const t=Object(r.useRef)({}),{listen:n}=e();return Object(r.useEffect)(()=>n("Fulfilled",()=>{t.current={}}),[n]),t}({useOrderQueue:s}),I=(({useOrderForm:e,useLogger:t,useOrderQueue:n,useQueueStatus:i})=>{const{log:a}=t(),{enqueue:u}=n(),s=i(),{setOrderForm:o}=e();return Object(r.useCallback)(e=>u(e.execute,e.id).then(e=>{k(0,a),"Fulfilled"===s.current?o(e):o(t=>{var n;return{...t,messages:{...e.messages,generalMessages:null===(n=e.messages)||void 0===n?void 0:n.generalMessages}}})},e=>{if(!e||e.code!==v.a)throw k(0,a),a({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"enqueue-task-error"}),e;k(e.index,a)}),[u,s,o,a])})({useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}),g=l(h),w=c(h),T=d(),x=Object(r.useRef)(t.items);Object(r.useEffect)(()=>{x.current=t.items},[t.items]);const C=Object(r.useCallback)(async(e,t)=>{var i,r,a;let u,s="";const o=x.current;if(e.id?u=o.findIndex(t=>q(e,t,o)):e.uniqueId?(s=e.uniqueId,u=o.findIndex(t=>t.uniqueId===e.uniqueId)):u=null!==(i=null==e?void 0:e.index)&&void 0!==i?i:-1,u<0||u>=o.length)throw new Error(`Item ${null!==(r=e.id)&&void 0!==r?r:e.uniqueId} not found`);s||(s=o[u].uniqueId);const l=null!==(a=e.quantity)&&void 0!==a?a:1;let d;n(e=>{const t=e.items.slice(),n=t[u],i={...n,quantity:l};return l>0?t[u]=i:t.splice(u,1),{...e,..._({totalizers:e.totalizers,currentValue:e.value,newItem:i,oldItem:n}),items:t}});let c=f();if(l>0){const n=y(m).queue;let i=-1;const r=c;for(let e=1;ee.quantity>0)?(i=e,c=t.id):(i=-1,c=r)}const a=-1===i?void 0:n[i],o="update_mutation"===(null==a?void 0:a.type)?a.variables.orderItems:[],f=o.findIndex(e=>"uniqueId"in e?e.uniqueId===s:e.index===u);let v={uniqueId:s,quantity:l};"index"in e&&(v={index:u,quantity:l}),d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:f>-1?o.map((e,t)=>t===f?v:e):o.concat([v])}}else d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:[{uniqueId:s,quantity:l}]};return b({id:c,type:"update_mutation",variables:d,orderFormItems:o},m),I(w({items:d.orderItems,orderFormItems:o,id:c,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem}))},[I,m,n,w]),E=Object(r.useCallback)(async(e,t)=>{const{salesChannel:i,marketingData:r,allowedOutdatedData:a,splitItem:u}=null!=t?t:{},{newItems:s,updatedItems:o}=e.reduce((t,n)=>{var i;const{newItems:r,updatedItems:a}=t,u=n.options&&n.options.length>0?void 0:x.current.find(t=>q(n,t,e));return null==u?r.push(n):a.push({...n,quantity:(null!==(i=n.quantity)&&void 0!==i?i:1)+u.quantity}),t},{newItems:[],updatedItems:[]}),l=[];if(o.length&&o.forEach(e=>{const t=C(e,{allowedOutdatedData:a,splitItem:u});l.push(t)}),0===s.length)return Promise.all(l).then(D);const d=s.map(O),c=s.map((e,t)=>M(d[t],e));n(e=>{var t;return{...e,items:[...x.current,...c],totalizers:c.reduce((e,t)=>_({totalizers:e,newItem:t}).totalizers,null!==(t=e.totalizers)&&void 0!==t?t:[]),marketingData:null!=r?r:e.marketingData,value:e.value+c.reduce((e,t)=>e+t.sellingPrice*t.quantity,0)}}),b({type:"add_mutation",variables:{items:d,marketingData:r,salesChannel:i,allowedOutdatedData:a},orderFormItems:c},m);const f=I(g({mutationInputItems:d,mutationInputMarketingData:r,orderFormItems:c,salesChannel:i,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData}));return Promise.all([...l,f]).then(D)},[g,I,m,n,C]),F=Object(r.useCallback)((e,t,n)=>E(e,{marketingData:t,salesChannel:n}),[E]),S=Object(r.useCallback)((e,t)=>{const n=T(e,t);n&&I(n)},[I,T]),j=Object(r.useCallback)((e,t)=>C({...e,quantity:0},t),[C]),P=Object(r.useMemo)(()=>({addItem:F,addItems:E,updateQuantity:C,removeItem:j,setManualPrice:S}),[F,E,C,j,S]);return Object(r.useEffect)(()=>{y(m).queue.forEach(e=>{"add_mutation"===e.type?I(g({mutationInputItems:e.variables.items,mutationInputMarketingData:e.variables.marketingData,orderFormItems:e.orderFormItems,salesChannel:e.variables.salesChannel,allowedOutdatedData:e.variables.allowedOutdatedData})):"update_mutation"===e.type&&I(w({items:e.variables.orderItems,orderFormItems:e.orderFormItems,allowedOutdatedData:e.variables.allowedOutdatedData,splitItem:e.variables.splitItem,id:e.id}))})},[g,I,m,w]),a.a.createElement(p.Provider,{value:P},e)}}}function F({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u}){return E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u})}},,,,,,,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(0);const r={cancel:Object.create(null),timeout:Object.create(null)},a="drained",u="error",s="timeout";function o(){}class l{constructor(e){var t,n;this.queue=[],this._isClosed=!1,this.waiters=[],e||(e={}),this.defaultTimeout=e.timeout,this.name=null!==(t=e.name)&&void 0!==t?t:"SequentialTaskQueue",this.scheduler=null!==(n=e.scheduler)&&void 0!==n?n:l.defaultScheduler}get isClosed(){return this._isClosed}push(e,t){if(this._isClosed)throw new Error(this.name+" has been previously closed");const n={callback:e,args:(null==t?void 0:t.args)?Array.isArray(t.args)?t.args.slice():[t.args]:[],timeout:void 0!==(null==t?void 0:t.timeout)?t.timeout:this.defaultTimeout,cancellationToken:{cancel:e=>this.cancelTask(n,e)},resolve:void 0,reject:void 0};n.args.push(n.cancellationToken),this.queue.push(n),this.scheduler.schedule(()=>this.next());const i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return i.cancel=e=>n.cancellationToken.cancel(e),i}cancel(){this.currentTask&&this.cancelTask(this.currentTask,r.cancel);const e=this.queue.splice(0);return e.length&&(e.forEach(e=>this.cancelTask(e,r.cancel)),this.emit(a)),this.wait()}indexOf(e){var t;if((null===(t=this.currentTask)||void 0===t?void 0:t.callback)===e)return 0;const n=this.queue.filter(e=>{var t;return!(null===(t=e.cancellationToken)||void 0===t?void 0:t.cancelled)}).findIndex(t=>t.callback===e);return n<0?n:n+(void 0!==this.currentTask?1:0)}close(e){return!this._isClosed&&(this._isClosed=!0,e)?this.cancel():this.wait()}async wait(){return this.currentTask||0!==this.queue.length?new Promise(e=>{this.waiters.push(e)}):Promise.resolve()}on(e,t){var n;this.events=null!==(n=this.events)&&void 0!==n?n:{},(this.events[e]||(this.events[e]=[])).push(t)}once(e,t){const n=(...i)=>{this.removeListener(e,n),t.apply(this,i)};this.on(e,n)}removeListener(e,t){if(this.events){const n=this.events[e];if(n){let e=0;for(;ee.apply(this,t))}catch(t){console.error(`${this.name}: Exception in '${e}' event handler`,t)}}next(){if(!this.currentTask){let t=this.queue.shift();for(;null==t?void 0:t.cancellationToken.cancelled;)t=this.queue.shift();if(t)try{this.currentTask=t,t.timeout&&(t.timeoutHandle=setTimeout(()=>{this.emit(s),this.cancelTask(t,r.timeout)},t.timeout));const n=t.callback.apply(void 0,t.args);n&&((e=n)&&"function"==typeof e.then)?n.then(e=>{t.result=e,this.doneTask(t)},e=>{this.doneTask(t,e)}):(t.result=n,this.doneTask(t))}catch(e){this.doneTask(t,e)}else this.callWaiters()}var e}cancelTask(e,t){e.cancellationToken.cancelled=!0,e.cancellationToken.reason=t,this.doneTask(e)}doneTask(e,t){e.timeoutHandle&&clearTimeout(e.timeoutHandle),e.cancellationToken.cancel=o,t?(this.emit(u,t),e.reject.call(void 0,t)):e.cancellationToken.cancelled?e.reject.call(void 0,e.cancellationToken.reason):e.resolve.call(void 0,e.result),this.currentTask===e&&(this.currentTask=void 0,this.queue.length?this.scheduler.schedule(()=>this.next()):(this.emit(a),this.callWaiters()))}callWaiters(){this.waiters.splice(0).forEach(e=>e())}}l.defaultScheduler={schedule:e=>setTimeout(()=>e(),0)},l.defaultScheduler={schedule:"function"==typeof e?t=>e(()=>t()):e=>setTimeout(()=>e(),0)};const d="TASK_CANCELLED",c={id:"default-order-form",items:[],value:-1,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};Object(i.createContext)(void 0);var m,f,v,h,p;p=!("undefined"==typeof window||!window.document||!window.document.createElement)&&(null===(h=null===(v=null===(f=null===(m=window)||void 0===m?void 0:m.__RUNTIME__)||void 0===f?void 0:f.settings)||void 0===v?void 0:v["vtex.store"])||void 0===h?void 0:h.enableOrderFormOptimization),Object(i.createContext)({orderForm:c,setOrderForm:()=>{},error:void 0,loading:!1})}).call(this,n(15).setImmediate)},,,function(e,t,n){var i="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new a(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(16),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof global&&global.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof global&&global.clearImmediate||this&&this.clearImmediate},function(e,t,n){(function(e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,a,u,s,o=1,l={},d=!1,c=t.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(t);m=m&&m.setTimeout?m:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){v(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){v(e.data)},i=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(e){var t=c.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(v,0,e)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&v(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(u+e,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c}).call(this,r(49))},,,function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n1)for(var r=1;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(2);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(59),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(20);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}]]); },function(){ (window.webpackJsonpvtex_cross_device_cart_1_4_9=window.webpackJsonpvtex_cross_device_cart_1_4_9||[]).push([["index"],[function(e,n){e.exports=React},function(e,n){e.exports=ReactIntl},,,function(e,n){e.exports=ReactApollo},,function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getAppSettings"},variableDefinitions:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.cross-device-cart@1.4.9",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"settings"},name:{kind:"Name",value:"getAppSettings"},arguments:[],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"0018700d24225804136ded4d522771509143bc195c210149b87d2f801c266caa",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isAutomatic"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"strategy"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:238}};a.loc.source={body:'query getAppSettings @context(sender: "vtex.cross-device-cart@1.4.9") {\n settings: getAppSettings @runtimeMeta(hash: "0018700d24225804136ded4d522771509143bc195c210149b87d2f801c266caa") {\n isAutomatic\n strategy\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var a=0;a0;){var c=d;d=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(a,"getAppSettings")},,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},,,,,,,,,,,,,,,,,,,,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.session-client@1.x/useRenderSession"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ToastConsumer"]},function(e,n){e.exports=__RENDER_8_RUNTIME__},,function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getSavedCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"nullOnEmpty"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.cross-device-cart@1.4.9",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"id"},name:{kind:"Name",value:"getSavedCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"nullOnEmpty"},value:{kind:"Variable",name:{kind:"Name",value:"nullOnEmpty"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"095c76ba2cb36f3ccb71775ca55fa75a6b9423c15b242e2b653f97e55f668e72",block:!1}}]}]}]}}],loc:{start:0,end:263}};a.loc.source={body:'query getSavedCart($userId: String!, $nullOnEmpty: Boolean) @context(sender: "vtex.cross-device-cart@1.4.9") {\n id: getSavedCart(userId: $userId, nullOnEmpty: $nullOnEmpty) @runtimeMeta(hash: "095c76ba2cb36f3ccb71775ca55fa75a6b9423c15b242e2b653f97e55f668e72")\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var a=0;a0;){var c=d;d=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(a,"getSavedCart")},function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"saveCurrentCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderFormId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.cross-device-cart@1.4.9",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"df726637adf2f675f22e1ff48f083d65b1a24ecf3ce62f16b0189e4dfaf8ec77",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"saveCurrentCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}},{kind:"Argument",name:{kind:"Name",value:"orderFormId"},value:{kind:"Variable",name:{kind:"Name",value:"orderFormId"}}}],directives:[]}]}}],loc:{start:0,end:267}};a.loc.source={body:'mutation saveCurrentCart($userId: String!, $orderFormId: String) @context(sender: "vtex.cross-device-cart@1.4.9") @runtimeMeta(hash: "df726637adf2f675f22e1ff48f083d65b1a24ecf3ce62f16b0189e4dfaf8ec77") {\n saveCurrentCart(userId: $userId, orderFormId: $orderFormId)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var a=0;a0;){var c=d;d=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(a,"saveCurrentCart")},function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"replaceCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"savedCart"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currentCart"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"strategy"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Strategy"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.cross-device-cart@1.4.9",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"e276cbbd951ac27cf5f133b5ff7098e2f9218c2c870dd91e1c989301b314b119",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"newOrderForm"},name:{kind:"Name",value:"replaceCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"savedCart"},value:{kind:"Variable",name:{kind:"Name",value:"savedCart"}}},{kind:"Argument",name:{kind:"Name",value:"currentCart"},value:{kind:"Variable",name:{kind:"Name",value:"currentCart"}}},{kind:"Argument",name:{kind:"Name",value:"strategy"},value:{kind:"Variable",name:{kind:"Name",value:"strategy"}}}],directives:[]}]}}],loc:{start:0,end:326}};a.loc.source={body:'mutation replaceCart($savedCart: String!, $currentCart: String!, $strategy: Strategy!) @context(sender: "vtex.cross-device-cart@1.4.9") @runtimeMeta(hash: "e276cbbd951ac27cf5f133b5ff7098e2f9218c2c870dd91e1c989301b314b119") {\n newOrderForm: replaceCart(savedCart: $savedCart, currentCart: $currentCart, strategy: $strategy)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var a=0;a0;){var c=d;d=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(a,"replaceCart")},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ButtonWithIcon"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconClose"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},,function(e,n,a){"use strict";a.r(n),function(e){var n=a(5);a.p=Object(n.getPublicPath)("vtex.cross-device-cart@1.4.9");var t=Object(n.register)((function(){return a(63)}),e,"vtex.cross-device-cart@1.4.9","vtex.cross-device-cart@1.x","index");t.renderHotReload,t.setupHMR}.call(this,a(12)(e))},function(e,n){e.exports=regeneratorRuntime},,,,,,,,,,,,,,,,,,,,function(e,n,a){"use strict";a.r(n);var t=a(3),i=a(0),r=a.n(i),o=a(29),d=a.n(o),c=a(8),s=a(30),u=a.n(s),l=a(4),m=a(7),f=a.n(m),v=a(11),k=a(1),p=a(31),b=a(32),g=a.n(b),N=a(33),h=a.n(N),S=a(34),E=a.n(S),y=a(35),x=a.n(y),_=a(36),O=a.n(_),C=a(37),D=a.n(C),w=a(38),F=a.n(w),I=a(39),V=a.n(I),T=a(40),A=a.n(T),R=["actionBar","challengeText"],j=r.a.createElement(V.a,null),M=function(e){var n=e.handleAccept,a=e.handleDecline,t=e.mutationLoading,o=O()().device,d=A()(R),c="".concat("phone"===o?"flex-column":"");return r.a.createElement(i.Fragment,null,r.a.createElement("div",{className:"".concat(c," pa4 tc w-100 bg-base flex items-center justify-center ").concat(d.actionBar)},r.a.createElement("span",{className:"".concat(d.challengeText," t-small ").concat("phone"===o?"pb3":"")},r.a.createElement(k.FormattedMessage,{id:"store/crossCart.challenge.text"})),r.a.createElement("div",{className:"flex"},r.a.createElement("span",{className:"mh4"},r.a.createElement(D.a,{size:"small",variation:"secondary",onClick:function(){n()},isLoading:t},r.a.createElement(k.FormattedMessage,{id:"store/crossCart.challenge.cta"}))),r.a.createElement("span",null,r.a.createElement(F.a,{size:"small",icon:j,variation:"tertiary",onClick:function(){a()},isLoading:t})))))};function P(e,n){return e?"".concat(e).concat(n):n}var $=function(e){var n=e.userId,a=e.isAutomatic,o=e.strategy,d=e.showToast,s=Object(c.useOrderForm)(),u=s.orderForm,m=s.initialFetchComplete,b=s.setOrderForm,N=Object(p.useRuntime)().rootPath,S=void 0===N?"":N,y=Object(i.useState)(!1),_=Object(t.a)(y,2),O=_[0],C=_[1],D=Object(i.useState)(!1),w=Object(t.a)(D,2),F=w[0],I=w[1],V=Object(k.useIntl)(),T=u.items.length,A=Object(l.useLazyQuery)(h.a,{fetchPolicy:"no-cache"}),R=Object(t.a)(A,2),j=R[0],$=R[1],L=$.data,q=$.loading,z=Object(l.useMutation)(E.a),B=Object(t.a)(z,1)[0],Q=Object(l.useMutation)(x.a),G=Object(t.a)(Q,2),H=G[0],J=G[1],U=J.error,W=J.loading;Object(i.useEffect)((function(){j({variables:{userId:n,nullOnEmpty:!a}})}),[]);var K=function(){var e=Object(v.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F&&I(!1),e.next=3,B({variables:{userId:n,orderFormId:T?u.id:null}});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=Object(v.a)(f.a.mark((function e(){var t,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null==L?void 0:L.id)&&!O){e.next=2;break}return e.abrupt("return");case 2:return C(!0),e.next=5,H({variables:{currentCart:u.id,savedCart:L.id,strategy:o}});case 5:if(t=e.sent,!U&&t.data&&t.data.newOrderForm){e.next=10;break}return U&&console.error(U),d({message:V.formatMessage({id:"store/crossCart.toast.error"})}),e.abrupt("return");case 10:return e.prev=10,i=P(S,"/api/checkout/pub/orderForm/".concat(L.id)),e.next=14,g.a.post(i,{},{headers:{"set-cookie":"checkout.vtex.com=__ofid=".concat(L.id)}});case 14:e.next=21;break;case 16:return e.prev=16,e.t0=e.catch(10),F&&I(!1),d({message:V.formatMessage({id:"store/crossCart.toast.error"})}),e.abrupt("return");case 21:r=t.data.newOrderForm,b(r),F&&I(!1),d({message:V.formatMessage({id:"store/crossCart.toast.success"})}),j({variables:{userId:n,nullOnEmpty:!a}});case 26:case"end":return e.stop()}}),e,null,[[10,16]])})));return function(){return e.apply(this,arguments)}}();return Object(i.useEffect)((function(){if(!q&&L&&m&&"default-order-form"!==(null==u?void 0:u.id)){var e="default-order-form"!==(null==L?void 0:L.id)&&(null==L?void 0:L.id);if(e){if(!(e===u.id))return!a&&I(!0),void(a&&X());T||a||B({variables:{userId:n,orderFormId:null}})}else B({variables:{userId:n,orderFormId:u.id}})}}),[q,L,T,m,u.id]),!F||a?null:r.a.createElement(M,{handleAccept:X,handleDecline:K,mutationLoading:W})},L=a(6),q=a.n(L);n.default=function(){var e=d()(),n=e.loading,a=e.session,o=e.error,s=Object(c.useOrderForm)().loading,m=Object(i.useState)({}),f=Object(t.a)(m,2),v=f[0],k=f[1],p=Object(l.useQuery)(q.a,{ssr:!1}).data;if(Object(i.useEffect)((function(){p&&k(p.settings)}),[p]),o||n||!a||s||!p)return null;var b=a.namespaces.profile,g=v.isAutomatic,N=v.strategy;if(!("true"===(null==b?void 0:b.isAuthenticated.value)))return null;var h=null==b?void 0:b.id.value;return r.a.createElement(u.a,null,(function(e){var n=e.showToast;return r.a.createElement($,{showToast:n,userId:h,isAutomatic:g,strategy:N})}))}}],[[42,"common",0]]]); },function(){ !function(t){function n(n){for(var r,u,c=n[0],a=n[1],f=n[2],s=0,p=[];st.length)&&(n=t.length);for(var e=0,r=new Array(n);e=0||(o[e]=t[e]);return o}e.d(n,"a",(function(){return r}))},,function(t,n,e){"use strict";function r(t,n){return(r=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function o(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&r(t,n)}e.d(n,"a",(function(){return o}))},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.d(n,"a",(function(){return i}));var o=e(10);function i(t,n){return!n||"object"!==r(n)&&"function"!=typeof n?Object(o.a)(t):n}}]); },function(){ (window.webpackJsonpmitiendamx_shopping_list_0_2_42=window.webpackJsonpmitiendamx_shopping_list_0_2_42||[]).push([[3],{35:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},47:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);var o=function(e){var t=Object(r.useRef)(e);return Object(r.useEffect)((function(){t.current=e}),[e]),t};function i(e){var t=o(e);return Object(r.useCallback)((function(){return t.current&&t.current.apply(t,arguments)}),[t])}},62:function(e,t,n){"use strict";t.a=!("undefined"==typeof window||!window.document||!window.document.createElement)},63:function(e,t,n){"use strict";var r=function(){};e.exports=r},80:function(e,t,n){"use strict";var r=n(8),o=n(34),i=n(1),a=n.n(i),c=n(0),f=n.n(c),s=n(25),u=n.n(s);function p(){return Object(c.useState)(null)}var l=function(e){return e&&"function"!=typeof e?function(t){e.current=t}:e};var d=function(e,t){return Object(c.useMemo)((function(){return function(e,t){var n=l(e),r=l(t);return function(e){n&&n(e),r&&r(e)}}(e,t)}),[e,t])},v="top",m="bottom",b="right",h="left",y=[v,m,b,h],g=y.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),w=[].concat(y,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),O=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];var x=function(e){var t=function(){var e=Object(c.useRef)(!0),t=Object(c.useRef)((function(){return e.current}));return Object(c.useEffect)((function(){return function(){e.current=!1}}),[]),t.current}();return[e[0],Object(c.useCallback)((function(n){if(t())return e[1](n)}),[t,e[1]])]};function E(e){return e.split("-")[0]}function j(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function D(e){var t=j(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function k(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return e instanceof k(e).Element||e instanceof Element}function L(e){return e instanceof k(e).HTMLElement||e instanceof HTMLElement}function A(e){return"undefined"!=typeof ShadowRoot&&(e instanceof k(e).ShadowRoot||e instanceof ShadowRoot)}function P(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&A(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(e){return e?(e.nodeName||"").toLowerCase():null}function R(e){return k(e).getComputedStyle(e)}function _(e){return["table","td","th"].indexOf(M(e))>=0}function T(e){return((C(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return"html"===M(e)?e:e.assignedSlot||e.parentNode||(A(e)?e.host:null)||T(e)}function W(e){return L(e)&&"fixed"!==R(e).position?e.offsetParent:null}function B(e){for(var t=k(e),n=W(e);n&&_(n)&&"static"===R(n).position;)n=W(n);return n&&("html"===M(n)||"body"===M(n)&&"static"===R(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&L(e)&&"fixed"===R(e).position)return null;for(var n=S(e);L(n)&&["html","body"].indexOf(M(n))<0;){var r=R(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function H(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var q=Math.max,N=Math.min,U=Math.round;function V(e,t,n){return q(e,N(t,n))}function I(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function K(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var z={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,c=E(n.placement),f=H(c),s=[h,b].indexOf(c)>=0?"height":"width";if(i&&a){var u=function(e,t){return I("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:K(e,y))}(o.padding,n),p=D(i),l="y"===f?v:h,d="y"===f?m:b,g=n.rects.reference[s]+n.rects.reference[f]-a[f]-n.rects.popper[s],w=a[f]-n.rects.reference[f],O=B(i),x=O?"y"===f?O.clientHeight||0:O.clientWidth||0:0,j=g/2-w/2,k=u[l],C=x-p[s]-u[d],L=x/2-p[s]/2+j,A=V(k,L,C),P=f;n.modifiersData[r]=((t={})[P]=A,t.centerOffset=A-L,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&P(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},F={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,c=e.gpuAcceleration,f=e.adaptive,s=e.roundOffsets,u=!0===s?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:U(U(t*r)/r)||0,y:U(U(n*r)/r)||0}}(i):"function"==typeof s?s(i):i,p=u.x,l=void 0===p?0:p,d=u.y,y=void 0===d?0:d,g=i.hasOwnProperty("x"),w=i.hasOwnProperty("y"),O=h,x=v,E=window;if(f){var j=B(n),D="clientHeight",C="clientWidth";j===k(n)&&"static"!==R(j=T(n)).position&&(D="scrollHeight",C="scrollWidth"),j=j,o===v&&(x=m,y-=j[D]-r.height,y*=c?1:-1),o===h&&(O=b,l-=j[C]-r.width,l*=c?1:-1)}var L,A=Object.assign({position:a},f&&F);return c?Object.assign({},A,((L={})[x]=w?"0":"",L[O]=g?"0":"",L.transform=(E.devicePixelRatio||1)<2?"translate("+l+"px, "+y+"px)":"translate3d("+l+"px, "+y+"px, 0)",L)):Object.assign({},A,((t={})[x]=w?y+"px":"",t[O]=g?l+"px":"",t.transform="",t))}var X={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,c=n.roundOffsets,f=void 0===c||c,s={placement:E(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Y={passive:!0};var G={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,c=void 0===a||a,f=k(t.elements.popper),s=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&s.forEach((function(e){e.addEventListener("scroll",n.update,Y)})),c&&f.addEventListener("resize",n.update,Y),function(){i&&s.forEach((function(e){e.removeEventListener("scroll",n.update,Y)})),c&&f.removeEventListener("resize",n.update,Y)}},data:{}},Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(e){return e.replace(/left|right|bottom|top/g,(function(e){return Q[e]}))}var $={start:"end",end:"start"};function ee(e){return e.replace(/start|end/g,(function(e){return $[e]}))}function te(e){var t=k(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ne(e){return j(T(e)).left+te(e).scrollLeft}function re(e){var t=R(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function oe(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(M(t))>=0?t.ownerDocument.body:L(t)&&re(t)?t:e(S(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=k(r),a=o?[i].concat(i.visualViewport||[],re(r)?r:[]):r,c=t.concat(a);return o?c:c.concat(oe(S(a)))}function ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ae(e,t){return"viewport"===t?ie(function(e){var t=k(e),n=T(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,c=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,c=r.offsetTop)),{width:o,height:i,x:a+ne(e),y:c}}(e)):L(t)?function(e){var t=j(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ie(function(e){var t,n=T(e),r=te(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=q(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=q(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+ne(e),f=-r.scrollTop;return"rtl"===R(o||n).direction&&(c+=q(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:c,y:f}}(T(e)))}function ce(e,t,n){var r="clippingParents"===t?function(e){var t=oe(S(e)),n=["absolute","fixed"].indexOf(R(e).position)>=0&&L(e)?B(e):e;return C(n)?t.filter((function(e){return C(e)&&P(e,n)&&"body"!==M(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=ae(e,n);return t.top=q(r.top,t.top),t.right=N(r.right,t.right),t.bottom=N(r.bottom,t.bottom),t.left=q(r.left,t.left),t}),ae(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function fe(e){return e.split("-")[1]}function se(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?E(o):null,a=o?fe(o):null,c=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case v:t={x:c,y:n.y-r.height};break;case m:t={x:c,y:n.y+n.height};break;case b:t={x:n.x+n.width,y:f};break;case h:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var s=i?H(i):null;if(null!=s){var u="y"===s?"height":"width";switch(a){case"start":t[s]=t[s]-(n[u]/2-r[u]/2);break;case"end":t[s]=t[s]+(n[u]/2-r[u]/2)}}return t}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,c=n.rootBoundary,f=void 0===c?"viewport":c,s=n.elementContext,u=void 0===s?"popper":s,p=n.altBoundary,l=void 0!==p&&p,d=n.padding,h=void 0===d?0:d,g=I("number"!=typeof h?h:K(h,y)),w="popper"===u?"reference":"popper",O=e.elements.reference,x=e.rects.popper,E=e.elements[l?w:u],D=ce(C(E)?E:E.contextElement||T(e.elements.popper),a,f),k=j(O),L=se({reference:k,element:x,strategy:"absolute",placement:o}),A=ie(Object.assign({},x,L)),P="popper"===u?A:k,M={top:D.top-P.top+g.top,bottom:P.bottom-D.bottom+g.bottom,left:D.left-P.left+g.left,right:P.right-D.right+g.right},R=e.modifiersData.offset;if("popper"===u&&R){var _=R[o];Object.keys(M).forEach((function(e){var t=[b,m].indexOf(e)>=0?1:-1,n=[v,m].indexOf(e)>=0?"y":"x";M[e]+=_[n]*t}))}return M}var pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0===a||a,f=n.fallbackPlacements,s=n.padding,u=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,O=void 0===d||d,x=n.allowedAutoPlacements,j=t.options.placement,D=E(j),k=f||(D===j||!O?[Z(j)]:function(e){if("auto"===E(e))return[];var t=Z(e);return[ee(e),t,ee(t)]}(j)),C=[j].concat(k).reduce((function(e,n){return e.concat("auto"===E(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,c=n.flipVariations,f=n.allowedAutoPlacements,s=void 0===f?w:f,u=fe(r),p=u?c?g:g.filter((function(e){return fe(e)===u})):y,l=p.filter((function(e){return s.indexOf(e)>=0}));0===l.length&&(l=p);var d=l.reduce((function(t,n){return t[n]=ue(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[E(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:u,rootBoundary:p,padding:s,flipVariations:O,allowedAutoPlacements:x}):n)}),[]),L=t.rects.reference,A=t.rects.popper,P=new Map,M=!0,R=C[0],_=0;_=0,H=B?"width":"height",q=ue(t,{placement:T,boundary:u,rootBoundary:p,altBoundary:l,padding:s}),N=B?W?b:h:W?m:v;L[H]>A[H]&&(N=Z(N));var U=Z(N),V=[];if(i&&V.push(q[S]<=0),c&&V.push(q[N]<=0,q[U]<=0),V.every((function(e){return e}))){R=T,M=!1;break}P.set(T,V)}if(M)for(var I=function(e){var t=C.find((function(t){var n=P.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return R=t,"break"},K=O?3:1;K>0;K--){if("break"===I(K))break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function le(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function de(e){return[v,b,m,h].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ue(t,{elementContext:"reference"}),c=ue(t,{altBoundary:!0}),f=le(a,r),s=le(c,o,i),u=de(f),p=de(s);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}};var me={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=w.reduce((function(e,n){return e[n]=function(e,t,n){var r=E(e),o=[h,v].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],c=i[1];return a=a||0,c=(c||0)*o,[h,b].indexOf(r)>=0?{x:c,y:a}:{x:a,y:c}}(n,t.rects,i),e}),{}),c=a[t.placement],f=c.x,s=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=s),t.modifiersData[r]=a}};var be={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=se({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,c=void 0!==a&&a,f=n.boundary,s=n.rootBoundary,u=n.altBoundary,p=n.padding,l=n.tether,d=void 0===l||l,y=n.tetherOffset,g=void 0===y?0:y,w=ue(t,{boundary:f,rootBoundary:s,padding:p,altBoundary:u}),O=E(t.placement),x=fe(t.placement),j=!x,k=H(O),C="x"===k?"y":"x",L=t.modifiersData.popperOffsets,A=t.rects.reference,P=t.rects.popper,M="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,R={x:0,y:0};if(L){if(i||c){var _="y"===k?v:h,T="y"===k?m:b,S="y"===k?"height":"width",W=L[k],U=L[k]+w[_],I=L[k]-w[T],K=d?-P[S]/2:0,z="start"===x?A[S]:P[S],F="start"===x?-P[S]:-A[S],J=t.elements.arrow,X=d&&J?D(J):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=Y[_],Q=Y[T],Z=V(0,A[S],X[S]),$=j?A[S]/2-K-Z-G-M:z-Z-G-M,ee=j?-A[S]/2+K+Z+Q+M:F+Z+Q+M,te=t.elements.arrow&&B(t.elements.arrow),ne=te?"y"===k?te.clientTop||0:te.clientLeft||0:0,re=t.modifiersData.offset?t.modifiersData.offset[t.placement][k]:0,oe=L[k]+$-re-ne,ie=L[k]+ee-re;if(i){var ae=V(d?N(U,oe):U,W,d?q(I,ie):I);L[k]=ae,R[k]=ae-W}if(c){var ce="x"===k?v:h,se="x"===k?m:b,pe=L[C],le=pe+w[ce],de=pe-w[se],ve=V(d?N(le,oe):le,pe,d?q(de,ie):de);L[C]=ve,R[C]=ve-pe}}t.modifiersData[r]=R}},requiresIfExists:["offset"]};function ye(e,t,n){void 0===n&&(n=!1);var r,o,i=T(t),a=j(e),c=L(t),f={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(c||!c&&!n)&&(("body"!==M(t)||re(i))&&(f=(r=t)!==k(r)&&L(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:te(r)),L(t)?((s=j(t)).x+=t.clientLeft,s.y+=t.clientTop):i&&(s.x=ne(i))),{x:a.left+f.scrollLeft-s.x,y:a.top+f.scrollTop-s.y,width:a.width,height:a.height}}function ge(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=t.get(r);o&&e(o)}})),r.push(o)}(e)})),r}var we={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r